package com.tedu.springdemo.day04;


import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

//典型实例工厂   方法：返回值  返回对象
//@Bean  注解   用与方法上，返回对象

@Component
public class NetConnInstanceFactory {
    @Bean("nc")
    public NetConnection getInstance(){
        NetConnection nc=new NetConnection();
        nc.load(); nc.ping(); nc.conn();
        return  nc;
    }
}
